@extends('admin.main')
@section('body')
	<div class="main-title">
		<h2>{{isset($info['id']) ? '编辑':'新增'}}水桶数据</h2>
	</div>
	<div class="tab-wrap">
		<div class="tab-content">
			<form action="" method="post" class="form-horizontal">
				<!-- 基础 -->
				<div id="tab1" class="tab-pane in tab1">
					<div class="form-item">
						<label class="item-label">
							店铺名称<span class="check-tips"></span>
						</label>
						<div class="controls">
							<input type="text" name="shop_name" class="text input-large" readonly value="{{(isset($shop) && $shop) ? $shop['shop_name'] : (isset($info) && $info ? $info['shop']['shop_name'] : '')}}">
						</div>
					</div>
					<div class="form-item">
						<label class="item-label">水桶品牌<span class="check-tips"></span></label>
						<div class="controls">
							<select name="bucket_category_id">
								@if(count($category))
									@foreach($category as $v)
										<option value="{{$v['id']}}"
												@if(isset($info['bucket_category_id']) && $info['bucket_category_id'] == $v['id']) selected @endif>{{$v['title']}}</option>
									@endforeach
								@endif
							</select>
						</div>
					</div>
					<div class="form-item">
						<label class="item-label">
							水桶总数量<span class="check-tips"></span>
						</label>
						<div class="controls">
							<input type="text" name="total_bucket_num" class="text input-large" value="{{isset($info['total_bucket_num']) ? $info['total_bucket_num'] : 0}}">
						</div>
					</div>
					<div class="form-item">
						<label class="item-label">
							回桶数量<span class="check-tips"></span>
						</label>
						<div class="controls">
							<input type="text" name="total_back_bucket_num" class="text input-large" value="{{isset($info['total_back_bucket_num']) ? $info['total_back_bucket_num'] : 0}}">
						</div>
					</div>
				</div>
				<div class="form-item">
					<input type="hidden" name="id" value="{{isset($info['id']) ? $info['id'] : ''}}">
					<button type="submit" id="submit" class="btn submit-btn ajax-post" target-form="form-horizontal">确 定</button>
					<button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
				</div>
			</form>
		</div>
	</div>
@endsection
@section('script')
	<script type="text/javascript">
		$(function(){
			showTab();
			$("input[name=reply]").change(function(){
				var $reply = $(".form-item.reply");
				parseInt(this.value) ? $reply.show() : $reply.hide();
			}).filter(":checked").change();
		});
	</script>
@endsection
